<div>
    <div class="modal-header text-center">
        <h4 class="modal-title">{{statusTask.name}} - Rollup Status</h3>
    </div>

    <div class="modal-body">
        <div ng-if="!status.statuses">
            <table class="rollup-status">
                <tr><td class="text-info">Metric:</td><td>{{statusTask.metric_name}}</td></tr>
                <tr><td class="text-info">Id:</td><td>{{statusTask.id}}</td></tr>
                <tr><td class="text-info">Saved as:</td><td>{{statusTask.save_as}} </td></tr>
                <tr><td class="text-info">Executing on:</td><td>{{status.executing_host}} </td></tr>
                <tr><td class="text-info">Last Executed:</td><td>Never</td></tr>
                <tr><td class="text-info">Next execution:</td><td></td></tr>
                <tr><td class="text-info">Data points written:</td><td>0</td></tr>
                <tr><td class="text-info">Execution time:</td><td>0 ms</td></tr>
            </table>
        </div>

        <div ng-if="status.statuses">
            <table ng-repeat="taskStatus in status.statuses" class="rollup-status">
                    <tr><td class="text-info">Metric:</td><td>{{taskStatus.metric_name}}</td></tr>
                    <tr><td class="text-info">Id:</td><td>{{statusTask.id}}</td></tr>
                    <tr><td class="text-info">Saved as:</td><td>{{statusTask.save_as}} </td></tr>
                    <tr><td class="text-info">Executing on:</td><td>{{status.executing_host}} </td></tr>
                    <tr><td class="text-info">Last Executed:</td><td>{{taskStatus.last_executed}}</td></tr>
                    <tr><td class="text-info">Next execution:</td><td>{{status.next_scheduled}}</td></tr>
                    <tr><td class="text-info">Data points written:</td><td>{{taskStatus.data_point_count}}</td></tr>
                    <tr><td class="text-info">Execution time:</td><td>{{taskStatus.execution_length}} ms</td></tr>
                    <tr ng-if="taskStatus.error_message.length > 0"><td class="text-info">Error:</td><td>{{taskStatus.error_message}}</td></tr>
            </table>
        </div>
    </div>
</div>
